package com.sh.data.engine.common.enumDefinition;

import java.util.Objects;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/18 11:14
 */
public enum OfflineSyncTaskStatus {

    //  unrunning(1, "未运行"),
    torelease(1, "待发布"),
    released(2, "已发布"),
    unrunning(3, "未运行"),
    running(4, "运行中"),
    success(5, "成功"),
    failure(6, "失败"),
    stopped(7, "停止"),
    ignored(8, "归档");

    private Integer status;
    private String name;

    OfflineSyncTaskStatus(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getTaskStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    public static OfflineSyncTaskStatus getByStatus(Integer status) {
        for (OfflineSyncTaskStatus value : OfflineSyncTaskStatus.values()) {
            if (Objects.equals(value.status, status)) {
                return value;
            }
        }
        return null;
    }
}
